#/usr/bin/env python
# -*- coding: utf8 -*-
# title       :
# description :
# author      :'ShenMeng'


import time
import functools


def time_taken(func):
    """
    时间装饰器：计算函数运行时间
    """
    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        start_time = time.time()
        func(*args, **kwargs)
        end_time = time.time()
        take_time = end_time-start_time
        print('Elapsed Time: %s(ms) = %s(s)' % (take_time*1000, take_time))
    return wrapper